/// <reference path="../libs/mgp-plat.d.ts" />
namespace mgp.login {

    export var loginProxy: ILogin;

    export function init() {
        switch (mgp.plat.type) {
            case mgp.plat.PlatType.wx:
                loginProxy = new WxLogin();
                break;
            case mgp.plat.PlatType.oppo:
                loginProxy = new OppoLogin();
                break;
        }
    }
}

if (window) {
    if (window['mgp']) {
        window['mgp'].login = mgp.login;
    } else {
        window['mgp'] = mgp;
    }
    mgp.login.init();
}